<template>
  <div class="common-layout">
    <div>
      <a-page-header
        class="custom-header"
        title="题库"
        sub-title="行测详情题库"
        @back="() => $router.go(-1)"
      />
    </div>
    <div class="detail" v-for="(item, index) in admindetailStore.adminDetaildemo" :key="item.iid">
      <div class="question-header">
        <div class="question-number">题目 {{ index + 1 }}</div>
        <h2>{{ item.question }}</h2>
        <p>{{ item.options.optionA }}</p>
          <p>{{ item.options.optionB }}</p>
            <p>{{ item.options.optionC }}</p>
              <p>{{ item.options.optionD }}</p>
      </div>
      
      <div class="answer-section">
        <div class="answer-label">参考答案：</div>
        <p>{{ item.answer }}</p>
      </div>

      
    </div>
  </div>
</template>

<script setup lang="ts">
import { useAdminDetailStore } from '@/stores/adminskill/admindetail'
import { useRoute } from 'vue-router'
const route = useRoute()

const iid = Number(route.params.iid)
console.log(iid, '这是获取iid的数字')

const admindetailStore = useAdminDetailStore()
console.log(iid, typeof iid, '55555')
admindetailStore.adminDetailResultAction(iid)
</script>

<style lang="less" scoped>
.common-layout {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  
  .custom-header {
    border: none !important;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: white !important;
    border-radius: 12px 12px 0 0;
    padding: 20px 24px;
    
    :deep(.ant-page-header-heading-title),
    :deep(.ant-page-header-heading-sub-title) {
      color: white !important;
    }
    
    :deep(.ant-page-header-back-button) {
      color: white !important;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 50%;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      
      &:hover {
        background: rgba(255, 255, 255, 0.3);
      }
    }
  }
  
  .detail {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 3px 10px rgba(30, 136, 229, 0.1);
    border: 1px solid #eef6fd;
    position: relative;
    overflow: hidden;
    
    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: linear-gradient(to bottom, #1e88e5, #0d47a1);
    }
    
    .question-header {
      margin-bottom: 20px;
      padding-right: 40px;
      
      .question-number {
        position: absolute;
        top: 25px;
        right: 25px;
        background: #e3f2fd;
        color: #0d47a1;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 14px;
      }
      
      h2 {
        color: #0d47a1;
        font-size: 20px;
        line-height: 1.6;
        font-weight: 600;
        margin: 10px 0 0;
      }
    }
    
    .answer-section {
      margin: 25px 0;
      
      .answer-label {
        font-size: 30px;
        color: #1e88e5;
        font-weight: 600;
        margin-bottom: 10px;
      }
      
      p {
        background: #f9fbfd;
        padding: 18px;
        border-radius: 8px;
        font-size: 28px;
        line-height: 1.7;
        color: #455a64;
        border-left: 3px solid #64b5f6;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
        margin: 0;
      }
    }
    
    
  }
}

@media (max-width: 768px) {
  .common-layout {
    margin: 10px auto;
    padding: 0 10px;
    
    .detail {
      padding: 20px 15px;
      
      .question-header {
        padding-right: 0;
        
        .question-number {
          position: relative;
          top: 0;
          right: 0;
          margin-bottom: 10px;
          display: inline-block;
        }
        
        h2 {
          font-size: 30px;
        }
        P {
          font-size: 30px;
        }
      }
      
      .answer-section p {
        padding: 20px;
        font-size: 30px;
      }
    }
  }
}
</style>